#include <iostream>
#include <vector>

using namespace std;

class Solution1 {
public:
    double average(vector<int>& salary) {
        double sum = 0.0, n = salary.size() - 2;
        int mx = salary[0], mn = salary[0];
        for (int x : salary)
        {
            sum += x;
            mx = max(mx, x);
            mn = min(mn, x);
        }
        return (sum - mx - mn) / n;
    }
};

class Solution2 {
public:
    int jobScheduling(vector<int>& startTime, vector<int>& endTime, vector<int>& profit) {
        int n = startTime.size();
        vector<vector<int>> jobs(n);
        for (int i = 0; i < n; ++i)
            jobs[i] = { startTime[i], endTime[i], profit[i] };
        sort(jobs.begin(), jobs.end(), [](vector<int>& job1, vector<int>& job2) {
            return job1[1] < job2[1];
            });

        vector<int> dp(n + 1);
        for (int i = 1; i <= n; ++i)
        {
            int k = upper_bound(jobs.begin(), jobs.begin() + i - 1, jobs[i - 1][0], [&](int st, const vector<int>& job) -> bool {
                return st < job[1];
                }) - jobs.begin();
                dp[i] = max(dp[i - 1], dp[k] + jobs[i - 1][2]);
        }
        return dp[n];
    }
};

class Solution3 {
public:
    vector<int> decrypt(vector<int>& code, int k) {
        int n = code.size();
        vector<int> ans(n, 0);
        if (k == 0) return ans;
        int s = k < 0 ? (n + k) : 1;
        for (int i = 0; i < n; ++i, ++s)
        {
            for (int j = 0; j < abs(k); ++j)
            {
                int pos = (s + j) % n;
                ans[i] += code[pos];
            }
        }
        return ans;
    }
};

class Solution4 {
public:
    int n, m;
    int memo[71][71][71];

    int dj[3] = { -1,0,1 };
    int dk[3] = { -1,0,1 };

    int dfs(vector<vector<int>>& grid, int i, int j, int k)
    {
        if (i == n) return 0;
        if (memo[i][j][k] != -1) return memo[i][j][k];

        int mx = 0; int cur = j == k ? grid[i][j] : grid[i][j] + grid[i][k];
        for (int x = 0; x < 3; ++x)
            for (int y = 0; y < 3; ++y)
            {
                int j1 = j + dj[x]; int k1 = k + dk[y];
                if (j1 >= 0 && k1 >= 0 && j1 < m && k1 < m)
                {
                    mx = max(mx, dfs(grid, i + 1, j1, k1));
                }
            }
        return memo[i][j][k] = mx + cur;
    }

    int cherryPickup(vector<vector<int>>& grid) {
        n = grid.size(); m = grid[0].size();
        memset(memo, -1, sizeof(memo));
        return dfs(grid, 0, 0, m - 1);
    }
};

using ll = long long;

int main()
{
    int a, h, b, k;
    cin >> a >> h >> b >> k;
    ll res = 0;
    while (h > 0 && k > 0)
    {
        res += a + b;
        h -= b; k -= a;
    }

    if (h <= 0 && k <= 0) res += 0;
    else if (h <= 0) res += b * 10;
    else res += a * 10;

    cout << res << endl;
    return 0;
}